﻿using System;
using UnityEngine;
using DG.Tweening;

[CreateAssetMenu(fileName = "FadeAlphaOnExit", menuName = "Asset/LoadSceneScreenFX/FadeAlphaOnExit")]
internal class FadeAlphaOnExit : CommandLogicSOBase
{
    protected override void OnExecute(Action doneCB, object param = null)
    {
        var window = GameRoot.Instance.uIService.PopWindow<AlphaMaskWindow>();
        window.ResetSetScreenAlphaMask(new Vector3(0, 0, 0), 0);
        window.windowComp.BgRawImage.DOFade(1, 1f).OnComplete(() => { doneCB?.Invoke(); });
    }
}